Memory management device

ABSTRACT

Memory modules and associated devices and methods are provided using a memory copy function between a cache memory and a main memory that may be implemented in hardware. Address translation may additionally be provided.

REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No.15/527,138 filed on May 16, 2017, which is a National Phase entrance ofPCT Application No. PCT/EP2015/077507 filed on Nov. 24, 2015, whichclaims priority to Singapore Patent Application No. 10201407795P filedon Nov. 25, 2014, the contents of which are incorporated herein byreference in its entirety as if fully set forth.

TECHNICAL FIELD

The application relates to memory management devices and tocorresponding methods.

BACKGROUND

Memories are generally used to store data. Memory access times, togetherwith other parameters like processor speed, may determine a speed ofoperation of a system. For example, in conventional systems processorsmay not be able to perform other tasks, e.g. executing instructions,while accessing a memory. Therefore, memory management approaches havebeen developed to enable efficient memory access and/or efficienthandling of data stored in a memory.

US 20130057562 A1 shows techniques for accessing graphics data stored ina memory. In some implementations, the techniques may include performingdata modification tasks independently from an execution of one or moreprograms for example on a graphics processing unit (GPU), which is anexample for a processor. For instance, the techniques of this documentmay allow the GPU to separate tasks related to memory management anddata modification from tasks related to data processing, and allow forindependent execution of these tasks. As one example, techniquesdescribed in this document may allow the GPU to retrieve data frommemory or store data in memory, and in parallel with performing suchfunctions, execute instructions of one or more programs. As anotherexample, techniques described in this patent may allow the GPU toconvert data into a more suitable form, which instructions to beexecuted then utilize, independently from the execution of theinstructions themselves.

However, there is still a need for improved memory devices, memorymanagement systems and associated methods which may for example reducethe burden for a processor regarding memory operations.

SUMMARY

The independent claims define various aspects of the presentapplication. The dependent claims define further embodiments. Featuresfrom different claims may be combined unless noted otherwise.

According to one embodiment, the application provides a memory module,also referred to as data memory module herein, for a computing device.

The computing device is provided with a software program that includesinstructions for finding, organizing, and/or changing data. An exampleof the computing device is a computer or server. Another example may bean integrated system provided with a memory, a processor and othercomponents. The data memory module is used for storing e.g. the abovedata, which is used by the computing device.

The data memory module may include a main memory (e.g. main memoryunit), at least one cache memory (e.g. cache memory unit), and a memorycopy device (e.g. memory copy unit).

The cache memory is usually a smaller and faster memory, which storescopies of frequently used data of the main memory. A central processingunit (CPU) of a computer or other processor like a graphics processingunit (GPU) often uses the cache memory to reduce average time to accessdata from the main memory. In practice, a predetermined waiting time isusually required to synchronize data between the main memory and thecache memory.

This synchronization is especially important when large amounts of dataare involved and may keep data in the cache memory and the main memoryconsistent with each other.

The memory copy device is communicatively connected with the main memoryand with the cache memory.

The memory copy device comprises at least one Direct Memory Access (DMA)port, an address translation device and a cached access module device.

The DMA port is used for accessing data in the main memory and data inthe cache memory. Via the DMA port, the memory copy device is able toaccess data independently of a processor like a CPU or GPU.

The address translation device is used for translating between a memoryphysical address and a memory virtual address and/or between a cachememory address and a main memory address.

The cached access module device is used for reading and writing databetween the cache memory and the main memory via the DMA port formaintaining date integrity and coherence.

The DMA port allows transfer of data between the main memory and thecache memory independently of a processor like a CPU or GPU. In effect,in embodiments this makes the processor free to perform other tasksduring this access of data. This thereby allows for a more efficient useof computing resources, which is especially important when large amountsof data are transferred between the main memory and the cache memory.

This form of data transfer between the main memory and the cache memorymay largely be based on hardware to perform the data transfer. Forexample, the memory copy device may be implemented as an integratedcircuit like an application specific integrated circuit (ASIC) and maybe integrated together with the cache memory and the main memory. Thisform of data transfer may be faster and useful for transferring of largeamounts of data.

This approach is different from many conventional implementations thatuse a processor like a CPU for the data transfer between cache memoryand main memory, which is based largely on software running on theprocessor to do the data transfer.

According to another aspect, the instant application also provides acomputing device. The computing device includes at least one processingcore module and the above memory module. The processing core modulestores data in the memory module and reads data from the memory module.

According to yet another aspect, the instant application also provides acomputer server. The computer server comprises a network module thatincludes the above computing device.

The network module may include one or more devices selected from a groupconsisting of a router device, a gateway device, and a Network AttachedStorage (NAS) device.

According to yet another aspect, the instant application provides amethod of operating a memory module.

The method includes translating an address between memory physicaladdress and memory virtual address or between a cache memory address anda main memory address, e.g. by an address translation device. The methodfurther includes (e.g. after the address translation) reading and/orwriting data between a cache memory and a main memory via a DirectMemory Access (DMA) (e.g. a corresponding DMA port) in order to maintaindata integrity and coherence between the cache memory and the mainmemory. This may e.g. be performed by a cached access module device.

According to another aspect, the instant application provides a computerwith a memory device, a memory copy device, and a Central ProcessingUnit (CPU). The memory copy device may be a Hardware Memory Copy(HWMemCopy) engine.

The memory device in this aspect includes a main memory, a cache memory,and a buffer memory. The memory device may be implemented using aDynamic Random Access Memory (DRAM) and/or a Static Random Access Memory(SRAM).

Different from other memories of devices such as routers, gateways, andNetwork Attached Storage (NAS) devices, the memory copy device does notuse resources of a processor like a CPU. The memory copy device mayimprove networking throughput and/or may improve or maximise applicationperformance e.g. on embedded CPUs. It may efficiently keep load relatingto memory data away from a processor like a CPU or GPU. This load maycomprise load due to memory address translation and copying data, whichare described below.

Software applications of the computer often use a virtual addressschemes for memories for easier implementation.

The virtual address corresponds to a physical address. In one example,the memory device has a starting virtual address of 0x8000000, whichcorresponds to a physical address of 0x0000000.

The memory copy device may provide efficient translation of a virtualmemory address to its corresponding physical memory address.

The memory copy device also may copy data efficiently from a sourcememory segment to a destination memory segment while maintainingcoherency among the main memory, the cache memory and the buffer memory.

This coherency may involve copying or writing data in the buffer memory,also referred to as source buffer memory in this case, to the mainmemory, and if needed, to the cache memory. The data is sometimesreferred to as “dirty” lines.

Similarly, the coherency can also involve copying from the buffermemory, also referred to as destination buffer memory in this case, tothe main memory, and if needed, to the cache memory. After this, memoryeviction of the cache memory (destination) may be performed, and newdata may be written to the destination buffer memory.

A method of operating the memory copy device according to an embodimentwill now be described. The method includes a step of address translationand a step of cache memory coherency.

Referring to the address translation, during initialization or when amapping between a source memory segment and a destination memory segmentis changed, a software driver or other entity configures or generatesaddress translation rules for the memory copy device.

The software driver then provides a memory copy (memcopy) requestcommand to the memory copy device. The memory copy (memcopy) requestcommand indicates as to whether a source address and/or a destinationaddress are to be translated for optimizing use of virtual addresses,which are available in or used in a software for a particular operation.

The memory copy device later performs an appropriate translation ofaddresses based on the generated address translation rules. The memorycopy device may perform translation of addresses for an unmapped addressor can implement a simplified Memory Management Unit (MMU) logic formapped addresses.

Referring to the cache memory coherency, the software driver mayindicate with the memcopy request command to the memory copy device asto whether data is to be read from a source address and/or a destinationaddress or data is to be written to/through a cache memory.

If an access to a buffer memory of a cache memory is required, thememory copy device then may translate the respective address forpointing to a cache memory region address that corresponds to a physicaladdress space.

The memory copy device later may initiate a Direct Memory Access (DMA)read from the buffer memory or may initiate a DMA write to the buffermemory to maintain the cache memory coherent e.g. to the main memoryand/or buffer memory.

The DMA read and/or the DMA write may be done in a manner that traversesa Cache Memory Sub-system and Coherency Manager.

This may be done by using driver sideband signals or by performingaddress transformations or translations to a cache memory address space.One way this may be achieved is to present transformed “accessthrough”cache memory addresses to an interconnect, which then routes the samethrough a CPU cache memory subsystem (that may include the cache memory)using an I/O cache memory coherency port while presenting to it theoriginal address (before cache memory address transformation).

In short, in some aspects the instant application provides a hardwarememory copy module for performing a memory copy conventionally providedas a software command. This may be done by performing an addresstranslation between a physical address and a virtual address. Combinedwith a support of an homogenous data path from a source memory to adestination memory, software flags may be used to indicate whether datafrom the source memory is sent to a physical memory address or to acache (virtual) memory address. This may allow the source memory and thedestination memory to have different attributes.

In some aspects, the method of memory copy used by a system, withrespect to physical and virtual addresses, may be detected by checkingan Open Source driver used by the system.

The memory copy device provided by some aspects of the instantapplication may be different from a system that uses two copy processes.Such a system has more overhead and requires more system bandwidth toachieve or perform the same task.

The above is merely a brief overview over some features or elements ofsome embodiments and is not to be construed as limiting, as otherembodiments may comprise different features or elements. Features orelements from different embodiments may be combined with each other.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a memory copy engine.

DETAILED DESCRIPTION

In the following detailed description, details are provided to describeembodiments of the application. It shall be apparent to one skilled inthe art, however, that the embodiments may be practiced without suchdetails. In other word, a description of an embodiment with a pluralityof features or elements is merely to provide a better understanding tothe skilled person, but is not to be construed as indicated that allthese features or elements are necessary for implementation of anembodiment.

Some embodiments described may have similar parts. The similar parts mayhave same names or similar reference number. The description of one suchpart applies by reference to another similar part, where appropriate,thereby reducing repetition of text and providing a more concisedescription. This, however, does not imply that the similar parts arenecessarily implemented in the same manner.

FIG. 1 shows a computing module 10 illustrating an embodiment. Whilemodule 10 will be described as comprising a plurality of modules orsystems, two or more of these modules or systems may also be implementedtogether as a single module or system.

The computing module 10 includes a processor sub-system 13, a DoubleData Rate (DDR) synchronous Dynamic Random-Access Memory (DRAM) module16, and a hardware memory copy (HWMemCopy) engine 19.

The processor sub-system 13 comprises a first computing core 21 with afirst cache memory 24, a second computing core 26 with a second cachememory 28, and an Input Output Control Port (IOCU) module 30. In otherembodiments, only one such core or more than two cores may be provided.The cores may be implemented in a single processor (e.g. CPU or GPU),but may also be provided in different processors.

The HWMemCopy engine 19 includes an address translation module 32 and acached access module 34 with a memory input/output (I/O) module 37, witha command register 40, and with a result register 43.

The memory I/O module 37 is connected to an Interconnect module 46,which is connected to ports 48 of the IOCU module 30 and to DDR ports 51of the DDR DRAM module 16.

The command register 40 is connected to computing cores 21 and 26.

Result register 43 is connected to a Yield Manager module 52 that is inturn connected to the computing cores 21 and 26.

A method of using the HWMemCopy engine 19 is described below.

A software driver writes to registers of Address Translation module 32of the HWMemCopy engine 19 for configuring translation of virtual memoryaddress to physical memory address by the HWMemCopy engine 19. Insteadof a software driver (running e.g. on one or both of cores, 21, 26) alsoanother entity, e.g. a hardware module, may perform the correspondingfunctions in other embodiments.

The software driver also configures Cache Memory Access Transformparameters in the HWMemCopy engine 19 to enable the HWMemCopy engine 19to perform cache memory I/O operation.

When a memory copy operation is initiated, the software driver providesthe Command Register 40 of the HWMemCopy engine 19 with a source buffermemory address, a destination buffer memory address. The software driveralso provides the Command Register 40 with a flag data regarding sourceaddress translation, a flag data regarding destination addresstranslation, a flag data regarding cache source I/O buffer memory,and/or a flag data regarding cache destination I/O buffer memory.

The Address Translation Module 32 of the HWMemCopy engine 19 thenperforms translation of the source main memory address and thedestination main memory address, when needed.

Address Translation Module 32 also may also performs translation ofsource cache memory address and destination cache memory address, whenneeded.

HWMemCopy engine 19 then reads data from a source buffer memory andwrites corresponding data to a destination buffer memory using theMemory I/O module 37 that couples a DMA read channel to a DMA writechannel.

A DMA-R engine 55 of the Memory I/O module 37 later may sends thephysical source memory address and bytes per burst data to theInterconnect module 46 to read the source buffer memory.

The Interconnect module 46 decides to present the request to either theDDR port 51 or to the IOCU port 48 based on an address range of theaddress, e.g. based on whether the address belongs to an address rangefor the DDR memory, which may be an example for a main memory, or toanother memory like a cache memory or the processor sub-system ingeneral.

If the Interconnect module 46 directs the address to the IOCU port 48,the address has been adjusted to reflect its physical memory address.

The cache memory sub-system then reads data from the DDR port 51 if thereceived address is not in the cache memory 24 and/or 28.

The data, which is read by the DMA-R engine channel, is passed to theDMA-W engine channel, which transfers the source address and bytes perburst to the Interconnect module 46 for writing the data to a sourcebuffer memory.

The Interconnect module 46 later decides to present the data either tothe DDR port 51 or to the IOCU port 48 based on the memory address rangeof the destination memory address.

If the Interconnect module 46 transfers the memory address to IOCU port48, the memory address has been adjusted to reflect its physical memoryaddress of the destination memory.

The cache memory sub-system later writes the desired data via the DDRport 51 to maintain cache coherency. Some data in the cache memory 24and 28 may not be coherent and need not be written to the DDR port 51for improving performance. Also, cache data in a level one (L1) datacache can be replaced appropriately.

Once all burst segments of a DMA operation are complete, the HWMemCopyengine 19 issues an interrupt signal to the respective requesting CPUcore 21 or 26 regarding completion of the requested memory copy (memcpy)operation.

This manner of memory copy has an advantage of not hogging CPU time. TheHWMemCopy engine 19 especially improves networking throughput andmaximizes application performance for embedded CPU.

This is different from many kinds of software systems using a memorycopy, also called a memcpy function, which significantly hogs CPU timeas the CPU has to run the respective software. Examples of systems usingsuch a software approach are software system are routers, gateways, andNetwork Attached Storage (NAS) devices. In embodiments, theabove-described techniques may be used in such systems instead of theconventional software approach.

Although the above description contains much specificity, this shouldnot be construed as limiting the scope of the embodiments but merelyproviding a more detailed illustration.

The above stated advantages of some of the embodiments should not beconstrued as limiting the scope of the embodiments but merely to explainpossible achievements if the described embodiments are put intopractice. Other embodiments may not have such advantages as described.Thus, the scope of the application should be determined by the claimsand their equivalents, rather than by the examples given.

1. A memory module for a computing device, the memory module comprising:a main memory, at least one cache memory, a memory copy device beingconnected with the main memory and with the cache memory, wherein thememory copy device comprises at least one Direct Memory Access (DMA)port for accessing data in the main memory and data in the cache memory,the memory copy device further comprising a cached access module devicefor reading and writing data between the cache memory and the mainmemory via the DMA port for maintaining data integrity and coherencebetween the cache memory and the main memory, and an interconnect modulecoupled to the DMA port, the main memory and the at least one cachememory, wherein the interconnect module is configured to present arequest received from the DMA port to either a port of the main memoryor a port coupled to the cache memory based on an address range of amemory address of the request.
 2. The memory module of claim 1, whereinthe memory copy device further comprises: an address translation devicefor translating between a memory physical address and a memory virtualaddress.
 3. The memory module of claim 1, wherein the memory copy deviceis implemented in hardware.
 4. The memory module of claim 1, wherein thememory copy device is configured to perform the reading and writingwithout having to use a processor external to the memory copy device. 5.A computing device comprising: at least one processing core module; anda memory module comprising: a main memory, at least one cache memory, amemory copy device being connected with the main memory and with thecache memory, wherein the memory copy device comprises at least oneDirect Memory Access (DMA) port for accessing data in the main memoryand data in the cache memory, the memory copy device further comprisinga cached access module device for reading and writing data between thecache memory and the main memory via the DMA port for maintaining dataintegrity and coherence between the cache memory and the main memory,and an interconnect module coupled to the DMA port, the main memory andthe at least one cache memory, wherein the interconnect module isconfigured to present a request received from the DMA port to either aport of the main memory or a port coupled to the cache memory based onan address range of a memory address of the request, wherein theprocessing core module is configured to store data in the memory moduleand to reads data from the memory module.
 6. The computing device ofclaim 5 wherein the memory copy device further comprises: an addresstranslation device for translating between a memory physical address anda memory virtual address.
 7. The computing device of claim 5, whereinthe memory copy device is implemented in hardware. 8 The computingdevice of claim 5, wherein the memory copy device is configured toperform the reading and writing without having to use a processorexternal to the memory copy device.
 9. The computing device of claim 5,wherein the memory copy device of the memory module is configured toperform memory copy operations between the main memory and the cachememory of the memory module without using the processing core module.10. The computing device of claim 5, further comprising a network moduleto operate in a network.
 11. The computing device of claim 10, whereinthe network module comprises one or more devices selected from a groupconsisting of a router device, a gateway device, and a Network AttachedStorage (NAS) device.
 12. A method of operating a memory modulecomprising: translating, in a hardware device, between a memory physicaladdress and memory virtual address; and, in the hardware device, readingand writing data between a cache memory and a main memory via DirectMemory Access in order to maintain data integrity and coherence betweenthe cache memory and the main memory, wherein the memory module is amemory module comprising: a main memory, at least one cache memory, amemory copy device being connected with the main memory and with thecache memory, wherein the memory copy device comprises at least oneDirect Memory Access (DMA) port for accessing data in the main memoryand data in the cache memory, the memory copy device further comprisinga cached access module device for reading and writing data between thecache memory and the main memory via the DMA port, and an interconnectmodule coupled to the DMA port, the main memory and the at least onecache memory, wherein the interconnect module is configured to present arequest received from the DMA port to either a port of the main memoryor a port coupled to the cache memory based on an address range of amemory address of the request, and the hardware device is the memorycopy device of the memory module.
 13. The method of claim 12, whereinthe reading and writing is performed at least in part using thetranslating.